package org.hook.showcase.pattern.iterator.impl;

import org.hook.showcase.pattern.iterator.Iterator;
import org.hook.showcase.pattern.iterator.Menu;

public class DinerMenu implements Menu {
	public static final int MAX_ITEMS = 6;
	private MenuItem[] menuItmes;

	public DinerMenu() {
		menuItmes = new MenuItem[MAX_ITEMS];
		MenuItem item1 = new MenuItem();
		MenuItem item2 = new MenuItem();
		MenuItem item3 = new MenuItem();
		MenuItem item4 = new MenuItem();
		MenuItem item5 = new MenuItem();
		item1.setName("item1");
		item1.setPrice(.1f);
		item1.setDescription("description1");
		item2.setName("item2");
		item2.setPrice(.2f);
		item2.setDescription("description2");
		item3.setName("item3");
		item3.setPrice(.3f);
		item3.setDescription("description3");
		item4.setName("item4");
		item4.setPrice(.4f);
		item4.setDescription("description4");
		item5.setName("item5");
		item5.setPrice(.5f);
		item5.setDescription("description5");
		menuItmes[0] = item1;
		menuItmes[1] = item2;
		menuItmes[2] = item3;
		menuItmes[3] = item4;
		menuItmes[4] = item5;
	}

	public Iterator createIterator() {
		return new DinerMenuIterator(this.menuItmes);
	}
}
